<div style="padding: 15px;">
  <form class="layui-form" action="<?=url('admin/add')?>">
    <div class="layui-form-item">
      <label class="layui-form-label">名片标题</label>
      <div class="layui-input-inline">
        <input type="text" name="title" required  lay-verify="required" placeholder="请输入名片标题" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">例如:刘德华的微信名片</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">姓名</label>
      <div class="layui-input-block">
        <input type="text" name="name" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">手机号</label>
      <div class="layui-input-block">
        <input type="text" name="phone" required  lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">联系地址</label>
      <div class="layui-input-block">
        <input type="text" name="address" placeholder="请输入地址" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">经纬度</label>
      <div class="layui-input-inline">
        <input type="text" name="lat_lng" placeholder="请输入地址经纬度" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">打开百度地图,复制经纬度.<a target="_blank" href="http://api.map.baidu.com/lbsapi/getpoint/index.html">百度地图</a></div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">公司/店名</label>
      <div class="layui-input-inline">
        <input type="text" name="company" placeholder="请输入公司/店名" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">可不填</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">职位</label>
      <div class="layui-input-inline">
        <input type="text" name="position" placeholder="请输入职位" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">可不填</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">头像/店招</label>
      <div class="layui-input-block">
          <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="myupimg">
            <i class="layui-icon">&#xe67c;</i>上传头像
          </button>
          <input type="hidden" name="pic" value="" />
          <div style="display:inline-block;position:relative;">
              <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;display:none;" id="closeimg">x</span>
              <img id="pic" height=50 src="" />
          </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">座机号</label>
      <div class="layui-input-inline">
        <input type="text" name="tel" placeholder="请输入座机号" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">可不填</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">QQ号</label>
      <div class="layui-input-inline">
        <input type="text" name="qq" placeholder="请输入QQ号" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">可不填</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">网址</label>
      <div class="layui-input-inline">
        <input type="text" name="website" placeholder="请输入网址" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">可不填</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">微信号</label>
      <div class="layui-input-inline">
        <input type="text" name="wxid" placeholder="请输入微信号" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux">打开微信, 点击我. 顶部就是微信号</div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">微信二维码</label>
      <div class="layui-input-block">
          <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="myupimg_wx">
            <i class="layui-icon">&#xe67c;</i>上传二维码
          </button>
          <input type="hidden" name="pic_wx" value="" />
          <div style="display:inline-block;position:relative;">
              <span style="position:absolute;right:-15px; top:-15px;cursor:pointer;color:#ccc;font-size:24px;display:none;" id="closeimg_wx">x</span>
              <img id="pic_wx" height=50 src="" />
          </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">相册图</label>
      <div class="layui-input-block">
          <div class="layui-upload">
              <button type="button" class="layui-btn" _url="<?=url('bbs/api/upimg')?>" id="multiplepics">
                  <i class="layui-icon">&#xe67c;</i>上传多图
              </button>
              <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                  预览图：
                  <div class="layui-upload-list" id="multiplepicsshow"></div>
              </blockquote>
          </div>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">服务简介</label>
      <div class="layui-input-block">
           <textarea name="description" placeholder="请输入简介" class="layui-textarea"></textarea>
      </div>
    </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn"  lay-submit lay-filter="myform">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
          </div>
        </div>
  </form>
</div>
<script>
layui.use(['form', 'upload'], function(){
  var $ = layui.$
  ,upload = layui.upload
  ,form = layui.form;
  form.render();
  //var ue = UE.getEditor('container');
   var uploadInst = upload.render({
     elem: '#myupimg_wx' //绑定元素
     ,url: $("#myupimg_wx").attr('_url') //上传接口
     ,done: function(res){
       $("[name='pic_wx']").val(res.data.url);
       $("#pic_wx").attr('src',res.data.url);
       $("#closeimg_wx").show();
     }
     ,error: function(){
       //请求异常回调
     }
   });
});
</script>
